package com.cjjd.c.feature.subscribe;

import android.os.Bundle;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;

import com.cjjd.c.R;
import com.cjjd.c.base.ActionBarActivity;
import com.cjjd.c.utils.CommonUtil;

import java.util.ArrayList;
import java.util.List;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * ----------------------------------
 * Created by xyd on 2017/12/23.
 * <p/>
 * 描  述：
 * <p/>
 * 修订历史:
 * ----------------------------------
 */

public class HotelSearchActivity extends ActionBarActivity {
    @Bind(R.id.tv_hotel_title)
    EditText tvHotelTitle;
    @Bind(R.id.tv_cancel)
    TextView tvCancel;
    @Bind(R.id.ls_hot_search)
    ListView lsHotSearch;
    @Bind(R.id.ls_search_history)
    ListView lsSearchHistory;

    private HotSearchAdapter hotSearchAdapter;
    private SearchHistoryAdapter searchHistoryAdapter;

    @Override
    public Object getTitleString() {
        return null;
    }

    @Override
    public int getContentView() {
        return R.layout.activity_hotel_search;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ButterKnife.bind(this);
        initView();
    }

    private void initView() {

        // TODO: 2017/12/23 这里需要数据
        List<String> hotListData = new ArrayList<>();
        hotListData.add("1");
        hotListData.add("1");
        hotListData.add("1");
        hotListData.add("1");
        hotListData.add("1");
        hotListData.add("1");
        hotSearchAdapter = new HotSearchAdapter(mContext);
        hotSearchAdapter.setData(hotListData);
        lsHotSearch.setAdapter(hotSearchAdapter);
        CommonUtil.setListViewHeightBasedOnChildren(lsHotSearch);

        List<String> searchHistoryListData = new ArrayList<>();
        searchHistoryListData.add("1");
        searchHistoryAdapter = new SearchHistoryAdapter(mContext);
        searchHistoryAdapter.setData(searchHistoryListData);
        lsSearchHistory.setAdapter(searchHistoryAdapter);

        CommonUtil.setListViewHeightBasedOnChildren(lsSearchHistory);


    }

    @OnClick(R.id.tv_cancel)
    public void onViewClicked() {
        finish();
    }
}
